import {
  BwCustomComSoltTypeEnum,
  BwCustomComNodeAttrDataTypeEnum,
  BwCustomComNodeAttrFromTypeEnum,
  BwCustomComSlotParamDataTypeEnum,
  type BwCustomComNodeAttrModel,
  type BwCustomComNodeEnableSlotInfoModel,
} from '../../../../render/models'

const attrs: Record<string, BwCustomComNodeAttrModel> = {
  allowClear: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  disabled: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  dropdownMatchSelectWidth: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'true',
  },
  fieldNames: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.object,
    constValue: JSON.stringify({
      children: 'children',
      label: 'title',
      value: 'value',
    }),
  },
  labelInValue: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  listHeight: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.number,
    constValue: '256',
  },
  multiple: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  placement: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: 'bottomLeft',
  },
  showCheckedStrategy: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: 'SHOW_CHILD',
  },
  showSearch: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  size: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: 'default',
  },
  treeCheckable: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  treeCheckStrictly: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  treeData: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.array,
    constValue: JSON.stringify([]),
  },
  treeDataSimpleMode: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  treeDefaultExpandAll: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  treeIcon: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  treeLine: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  treeLoadedKeys: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.array,
    constValue: JSON.stringify([]),
  },
  treeNodeFilterProp: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: 'value',
  },
  treeNodeLabelProp: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: 'title',
  },
  virtual: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'true',
  },
}

const slotList: Array<BwCustomComNodeEnableSlotInfoModel> = [
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'maxTagPlaceholder',
      slotName: '隐藏 tag 时显示的内容插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'notFoundContent',
      slotName: '列表为空时显示内容插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'searchPlaceholder',
      slotName: '搜索框默认文字插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'suffixIcon',
      slotName: '后缀图标插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'tagRender',
      slotName: '自定义 tag 内容插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'title',
      slotName: '自定义标题插槽',
    },
  },
]

export const aTreeSelectOptions = {
  attrs,
  slotList,
}
